<?php
namespace Plugin\Attractions\AttractionManagement\Schema\Attraction_spot;

use Plugin\Attractions\AttractionManagement\Model\Attraction_spot\AttractionSpot;
use Hyperf\Swagger\Annotation\Property;
use Hyperf\Swagger\Annotation\Schema;

/**
 * 点位表
 */
#[Schema(title: 'AttractionSpotSchema')]
class AttractionSpotSchema implements \JsonSerializable
{
    #[Property(property: 'id', title: 'id', type: 'bigint')]
    public string $id;

    #[Property(property: 'name', title: '点位名称', type: 'varchar')]
    public string $name;

    #[Property(property: 'position_id', title: '位置Id', type: 'int')]
    public string $position_id;

    #[Property(property: 'type_id', title: '点位类型Id', type: 'int')]
    public string $type_id;

    #[Property(property: 'intro_title', title: '点位介绍标题', type: 'varchar')]
    public string $intro_title;

    #[Property(property: 'intro', title: '点位介绍', type: 'longtext')]
    public string $intro;

    #[Property(property: 'attraction_id', title: '所属景区Id', type: 'int')]
    public string $attraction_id;

    #[Property(property: 'cover_id', title: '点位封面', type: 'varchar')]
    public string $cover_id;

    #[Property(property: 'show_type', title: '显示类型1:管理端显示2:管理游客双端显示', type: 'int')]
    public string $show_type;

    #[Property(property: 'icon_id', title: '点位图标Id,关联attachment表', type: 'int')]
    public string $icon_id;

    #[Property(property: 'status', title: '点位状态1:禁用2:正常', type: 'int')]
    public string $status;

    #[Property(property: 'sort', title: '点位排序', type: 'int')]
    public string $sort;

    #[Property(property: 'extension', title: '点位扩展字段', type: 'json')]
    public string $extension;

    #[Property(property: 'created_at', title: 'created_at', type: 'datetime')]
    public string $created_at;

    #[Property(property: 'updated_at', title: 'updated_at', type: 'datetime')]
    public string $updated_at;




    public function __construct(AttractionSpot $model)
    {
       $this->id = $model->id;
       $this->name = $model->name;
       $this->position_id = $model->position_id;
       $this->type_id = $model->type_id;
       $this->intro_title = $model->intro_title;
       $this->intro = $model->intro;
       $this->attraction_id = $model->attraction_id;
       $this->cover_id = $model->cover_id;
       $this->show_type = $model->show_type;
       $this->icon_id = $model->icon_id;
       $this->status = $model->status;
       $this->sort = $model->sort;
       $this->extension = $model->extension;
       $this->created_at = $model->created_at;
       $this->updated_at = $model->updated_at;

    }

    public function jsonSerialize(): array
    {
        return ['id' => $this->id ,'name' => $this->name ,'position_id' => $this->position_id ,'type_id' => $this->type_id ,'intro_title' => $this->intro_title ,'intro' => $this->intro ,'attraction_id' => $this->attraction_id ,'cover_id' => $this->cover_id ,'show_type' => $this->show_type ,'icon_id' => $this->icon_id ,'status' => $this->status ,'sort' => $this->sort ,'extension' => $this->extension ,'created_at' => $this->created_at ,'updated_at' => $this->updated_at];
    }
}